Skip to content

Conversation

@etrandafir93
Copy link
Contributor

@etrandafir93 etrandafir93 commented Dec 21, 2025

@shakuzen, @marcingrzejszczak

Turns out there was an errorprone rule already that should guard against the exact issue we found in #6946
https://errorprone.info/bugpattern/ClassInitializationDeadlock
They even suggest some fixes, but all of them seem to introduce breaking changes

This successfully found 3 occurrences of this pattern: see job logs

Should we suppress the 3 errors for now, so that we can merge this? Or are we going to tackle the issue soon?

See gh-6998

@marcingrzejszczak
Copy link
Contributor

I would vote for suppression unless you fix the issue in the same PR :)

@shakuzen
Copy link
Member

@etrandafir93 good find on the errorprone check I didn't realize was available (probably a sign we have too many errorprone warnings that people tend to ignore them).
Feel free to suppress the cases now and we can figure out what to do about them in a separate pull request. It still adds value to fail on this check in other cases so we don't introduce more of this same issue with future changes.

Closes micrometer-metricsgh-6998

Signed-off-by: Emanuel Trandafir <[email protected]>
@etrandafir93
Copy link
Contributor Author

etrandafir93 commented Dec 22, 2025

@shakuzen, @marcingrzejszczak

The rule existed on errorprone's catalog, but it was not configured for the micrometer project.

I've added it in my first commit to see the build failing, and then suppress the warning for our 3 known issues in the 2nd commit.

So yes, if we add this anti-pattern again, the build will fail 👍

@shakuzen
Copy link
Member

Thanks for the quick updates.
Is the PR ready to merge or is there any reason it's still marked as a draft?

@etrandafir93 etrandafir93 marked this pull request as ready for review December 22, 2025 13:30
@etrandafir93
Copy link
Contributor Author

@shakuzen - yes, ready for merge.

@shakuzen shakuzen merged commit 1f9bb9c into micrometer-metrics:main Dec 22, 2025
11 checks passed
allnightlong pushed a commit to allnightlong/micrometer that referenced this pull request Jan 19, 2026
…s#7021)

This ensures we do not introduce new cases of this issue by failing the build when they are detected by ErrorProne.
It suppresses the warning on the existing cases we are aware of while we separately decide what to do about them.

See micrometer-metricsgh-6998

Signed-off-by: Emanuel Trandafir <[email protected]>
@shakuzen shakuzen added type: task A general task build A change in our build-system labels Jan 20, 2026
@shakuzen shakuzen added this to the 1.17.0-M1 milestone Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build A change in our build-system type: task A general task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants